package com.aispace.taichu.exception;

import com.aispace.taichu.response.ResponseStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 自定义异常
 * @author chengjie.guo
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class RestStatusException extends RuntimeException{

    private static final long serialVersionUID = -8541311111016065562L;

    private String message;

    private Integer code;

    public RestStatusException(ResponseStatus status) {
    	this.code=status.getCode();
    	this.message=status.getValue();
    }

    public RestStatusException(Integer code,String message) {
        this.code=code;
        this.message=message;
    }
}